<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>window窗口</title>
		<script>
			function getWindowInfo(){
				window.alert(window.outerHeight+"*"+window.outerWidth);
				alert(window.innerHeight+"*"+window.innerWidth);
				alert("浏览器信息："+window.navigator.userAgent);
				
			}
			function closeWin(){
				if(window.confirm("真的要关闭窗口？"))
					window.close();
			}
			function openAdv(){
				window.open("https://www.oschina.net","开源中国","resizable=no,fullscreen=yes");
			}
			function goBack(){
				window.history.back();
			}
			function goDizhi(){
				alert(window.location.host+",hostname:"+window.location.hostname+",href="+window.location.href);
				window.location='https://www.baidu.com';
			}
			function doReplace(){
				//没有后退
				window.location.replace("https://www.cnblogs.com");
			}
			/* function add(a,b){
				alert("调用了add,a="+a+",b="+b);
			} */
			function add(){
				alert("调用了add");
			}
		</script>
	</head>
	<body onload="getWindowInfo()">
		<input type="button" value="关闭窗口" onclick="closeWin()">
		<input type="button" value="打开oschina" onclick="openAdv()">
		<input type="button" value="后退" onclick="goBack()">
		<input type="button" value="地址信息" onclick="goDizhi()">
		<input type="button" value="刷新" onclick="location.reload()">
		<input type="button" value="替换" onclick="doReplace()">
		
		<input type="button" value="随便调用" onclick="add(3,5)">
		<!--让链接不起作用-->
		<a href="#">链接1</a>
		<a href="javascript:void();" onclick="xxx()">链接2</a>
	</body>
</html>
